package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.bean.CarBean;
import com.project.bean.ManBean;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface IManMapper extends BaseMapper<ManBean> {
    public List<ManBean> findAll();
    public void addCarList(@Param("manId") Integer manId,
                           @Param("carList") List<CarBean> carList);

    @Delete("update t_car set fk_manId=null where fk_manId=#{id};" +
            "delete from t_man where pk_manId=#{id};")
    public void delSetNull(Integer id);
}
